import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:yp/config/index.dart';
import 'package:yp/config/style.dart';
import 'package:yp/widgets/button_widget.dart';
import 'package:yp/widgets/index.dart';


/// 大转盘 助力详情
class BigTurntable extends StatelessWidget {
  const BigTurntable({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(
        BoxConstraints(
            maxWidth: MediaQuery.of(context).size.width,
            maxHeight: MediaQuery.of(context).size.height),
        designSize: Size(750, 1334),
        orientation: Orientation.portrait);
    return Scaffold(
        appBar: YPNavigationBar('大转盘'),
        body: SafeArea(
            child: SingleChildScrollView(
                child: Container(
          width: double.infinity,
          decoration: BoxDecoration(
            image: DecorationImage(
                fit: BoxFit.fill,
                image: AssetImage('assets/images/invitebg.png')),
          ),
          child: Column(children: [
            SizedBox(height: 60.w),
            EsOutLineButton(
              '已有0人参加活动',
              fontSize: EsSizes.LG * 2.sp,
              borderRadius: 60.w,
              bgColor: Color(0xffd72332),
              textColor: EsColors.White,
              padding: EdgeInsets.symmetric(vertical: 12.w, horizontal: 60.w),
            ),
            SizedBox(height: 200.w),
            Text(
              '88',
              style: TextStyle(
                  fontSize: 200.sp,
                  fontWeight: FontWeight.w700,
                  foreground: Paint()
                    ..shader = LinearGradient(
                        begin: Alignment.topCenter,
                        end: Alignment.bottomCenter,
                        colors: [
                          Colors.yellow,
                          Colors.red,
                        ]).createShader(Rect.fromLTWH(0, 300.w, 0, 200.w))),
            ),
            SizedBox(height: 200.w),
            Text('当前排名：NO.123',
                style: TextStyle(
                    fontSize: EsSizes.MD * 2.sp,
                    fontWeight: EsFontWeights.Medium,
                    color: EsColors.Primary)),
            SizedBox(height: 20.w),
            Container(
                width: double.infinity,
                height: 120.w,
                margin: EdgeInsets.symmetric(horizontal: 50.w),
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(60.w)),
                  image: DecorationImage(
                      fit: BoxFit.cover,
                      image: AssetImage('assets/images/invitebg.png')),
                ),
                child: Text('召集小伙伴',
                    style: TextStyle(
                        fontSize: 50.sp,
                        fontWeight: FontWeight.w800,
                        color: EsColors.Primary))),
            SizedBox(height: 40.w),
            Row(
              children: [
                Expanded(
                    child: Container(
                        height: 4.w,
                        color: EsColors.Fill,
                        margin: EdgeInsets.only(left: 60.w, right: 20.w))),
                Text('给力小伙伴',
                    style: TextStyle(
                        fontSize: EsSizes.XL * 2.sp,
                        fontWeight: EsFontWeights.Medium,
                        color: EsColors.White)),
                Expanded(
                    child: Container(
                        height: 4.w,
                        color: EsColors.Fill,
                        margin: EdgeInsets.only(left: 20.w, right: 60.w)))
              ],
            ),
            SizedBox(height: 10.w),
            ListView.builder(
                shrinkWrap: true,
                physics: NeverScrollableScrollPhysics(),
                padding: EdgeInsets.zero,
                itemCount: 4,
                itemBuilder: (context, index) {
                  return Padding(
                    padding:
                        EdgeInsets.symmetric(horizontal: 24.w, vertical: 12.w),
                    child: Row(children: [
                      Expanded(
                        child: Text('迪丽热巴',
                            style: TextStyle(
                                fontSize: EsSizes.MD * 2.sp,
                                fontWeight: EsFontWeights.Normal,
                                color: EsColors.White)),
                      ),
                      Expanded(
                        child: Text('2021-09-08 12：22',
                            style: TextStyle(
                                fontSize: EsSizes.MD * 2.sp,
                                fontWeight: EsFontWeights.Normal,
                                color: EsColors.White)),
                      ),
                    ]),
                  );
                }),
            SizedBox(height: 60.w),
            EsOutLineButton('参与详情',
                fontSize: EsSizes.LG * 2.w,
                // TODO 换成黄色
                bgColor: EsColors.White,
                textColor: EsColors.Pink,
                fontWeight: EsFontWeights.Medium,
                borderRadius: 50.w,
                padding: EdgeInsets.symmetric(
                    vertical: 30.w,
                    horizontal: MediaQuery.of(context).size.width / 12.w)),
            SizedBox(height: 60.w),
          ]),
        ))));
  }
}
